package com.dhl.fin.api.service.cronService;

import cn.hutool.core.date.DateUtil;
import com.dhl.fin.api.domain.RemindTask;
import org.springframework.stereotype.Service;

/**
 * @author CuiJianbo
 * @since 2025/5/5
 */
@Service
public class EveryMonthCron implements RemindCron {

    @Override
    public String calculateCron(RemindTask remindTask) {
        int day = DateUtil.dayOfMonth(remindTask.getRemindDate());
        String[] remindTime = remindTask.getRemindTime().split(":");
        return String.format("0 %s %s %d * ? ", remindTime[1], remindTime[0],day);
    }

}
